    /*************************************************
     *FileName:      register.js
     *Description:   注册.js
     *Others:        陈灿
     *************************************************/
    /*
     * 启动
     */
    mui.init();
    mui('.mui-scroll-wrapper').scroll({
        indicators: false,      //是否显示滚动条 默认为true
        deceleration: 0.003,    //阻尼系数,系数越小滑动越灵敏 默认0.0006
        bounce: false           //是否启用回弹 默认true
    });

    var code_mobile = '';
    /*
     * 变量初始化
     */
    
    /*
     * 主程序
     */ 
    $(document).ready(function() 
    {
        //样式加载
        pagecss();
    });
        
    function pagecss(){
        $('.wjmm').on('tap',function(){
            location.href="forgetpsd.html?that=login";
        })
        $('.zc').on('tap',function(){
            location.href="register.html";
        })
        $('.rdntn').on('tap', function(e) {
            e.preventDefault();
            $('.ys-input-list input').blur();
            var cid = plus.push.getClientInfo().clientid;
            // var cid = "6d97ac92478cafc0a1f1126e7f40db2e"
            var mobile = $("input[name='mobile']").val();
            var password = $("input[name='password']").val();
            if(mobile == '') {
                mui.toast('请输入手机号！',{ duration:2000, type:'div' });
                return false;
            }
            if(password == '') {
                mui.toast('请输入密码！',{ duration:2000, type:'div' });
                return false;
            }
            var reg = new RegExp(/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/);
            if(!reg.test(password)) {
                mui.toast('密码必须为数字和字母结合！',{ duration:2000, type:'div' });
                return false;
            }
            
            $('body').append('<div class="ys-modal-loading"><div class="mui-spinner"></div></div>');

            $('body').on('tap','.ys-modal-loading',function(){
                $(this).remove();
            })
            $.ajax({
                type: "post",
                url: DOMAIN_NAME + "/index.php/api/user/login",
                dataType:'jsonp',
                data: { mobile: mobile, password: password,cid:cid},
//              data: { mobile: mobile, password: password,},
                success: function(data) {
                    if(data.error_code == 0){
                        if(data.gestures_status == '1'){
                            localStorage.screens='true';
                        }else{
                            localStorage.screens='false';
                        }
                        localStorage.replace_token = data.access_token;
                        localStorage.replace_uid = data.uid;
                        localStorage.replace_nickname = data.nickname;
                        localStorage.replace_mobile = data.mobile;
                        data.face ? localStorage.replace_face= data.face : localStorage.replace_face= 'images/myimg.jpg';
                        localStorage.replace_sex = data.sex;
                        localStorage.replace_sex = data.sex;
                        localStorage.welcome='false';
                        $(".ys-modal-loading").remove();
                        mui.toast('登录成功！',{ duration:2000, type:'div' });
                        setTimeout(function(){
                            common.pageTransition('index.html')
                        },500);
                    }else{
                        $(".ys-modal-loading").remove();
                        mui.toast(data.error_msg,{ duration:2000, type:'div' });
                    }
                    
                }
            });
        });
    }